/*
** Lua binding: layerscript
** Generated automatically by tolua++-1.0.92 on Fri Jan 28 22:29:33 2011.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
TOLUA_API int  tolua_layerscript_open (lua_State* tolua_S);

#include "lua/lua_pixellayer.hpp"

/* function to release collected object via destructor */
#ifdef __cplusplus

static int tolua_collect_pm3__PIXELLAYER (lua_State* tolua_S)
{
 pm3::PIXELLAYER* self = (pm3::PIXELLAYER*) tolua_tousertype(tolua_S,1,0);
	delete self;
	return 0;
}
#endif


/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
 tolua_usertype(tolua_S,"pm3::PIXELLAYER");
}

/* method: new of class  pm3::PIXELLAYER */
#ifndef TOLUA_DISABLE_tolua_layerscript_pm3_LAYER_new00
static int tolua_layerscript_pm3_LAYER_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"pm3::PIXELLAYER",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELLAYER* tolua_ret = (pm3::PIXELLAYER*)  new pm3::PIXELLAYER();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"pm3::PIXELLAYER");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new_local of class  pm3::PIXELLAYER */
#ifndef TOLUA_DISABLE_tolua_layerscript_pm3_LAYER_new00_local
static int tolua_layerscript_pm3_LAYER_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"pm3::PIXELLAYER",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELLAYER* tolua_ret = (pm3::PIXELLAYER*)  new pm3::PIXELLAYER();
   tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"pm3::PIXELLAYER");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: delete of class  pm3::PIXELLAYER */
#ifndef TOLUA_DISABLE_tolua_layerscript_pm3_LAYER_delete00
static int tolua_layerscript_pm3_LAYER_delete00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELLAYER",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELLAYER* self = (pm3::PIXELLAYER*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
#endif
  delete self;
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: load_image of class  pm3::PIXELLAYER */
#ifndef TOLUA_DISABLE_tolua_layerscript_pm3_LAYER_load_image00
static int tolua_layerscript_pm3_LAYER_load_image00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELLAYER",0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,2,0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,3,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,4,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELLAYER* self = (pm3::PIXELLAYER*)  tolua_tousertype(tolua_S,1,0);
  const std::string r_path = ((const std::string)  tolua_tocppstring(tolua_S,2,0));
  const std::string r_group = ((const std::string)  tolua_tocppstring(tolua_S,3,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'load_image'",NULL);
#endif
  {
   bool tolua_ret = (bool)  self->load_image(r_path,r_group);
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
   tolua_pushcppstring(tolua_S,(const char*)r_path);
   tolua_pushcppstring(tolua_S,(const char*)r_group);
  }
 }
 return 3;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'load_image'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: get_room_var of class  pm3::PIXELLAYER */
#ifndef TOLUA_DISABLE_tolua_layerscript_pm3_LAYER_get_room_var00
static int tolua_layerscript_pm3_LAYER_get_room_var00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELLAYER",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,4,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,5,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELLAYER* self = (pm3::PIXELLAYER*)  tolua_tousertype(tolua_S,1,0);
  int i_x = ((int)  tolua_tonumber(tolua_S,2,0));
  int i_y = ((int)  tolua_tonumber(tolua_S,3,0));
  const std::string r_name = ((const std::string)  tolua_tocppstring(tolua_S,4,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'get_room_var'",NULL);
#endif
  {
   std::string tolua_ret = (std::string)  self->get_room_var(i_x,i_y,r_name);
   tolua_pushcppstring(tolua_S,(const char*)tolua_ret);
   tolua_pushcppstring(tolua_S,(const char*)r_name);
  }
 }
 return 2;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_room_var'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: set_room_var of class  pm3::PIXELLAYER */
#ifndef TOLUA_DISABLE_tolua_layerscript_pm3_LAYER_set_room_var00
static int tolua_layerscript_pm3_LAYER_set_room_var00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELLAYER",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,4,0,&tolua_err) ||
     !tolua_iscppstring(tolua_S,5,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,6,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELLAYER* self = (pm3::PIXELLAYER*)  tolua_tousertype(tolua_S,1,0);
  int i_x = ((int)  tolua_tonumber(tolua_S,2,0));
  int i_y = ((int)  tolua_tonumber(tolua_S,3,0));
  const std::string r_name = ((const std::string)  tolua_tocppstring(tolua_S,4,0));
  const std::string r_val = ((const std::string)  tolua_tocppstring(tolua_S,5,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_room_var'",NULL);
#endif
  {
   bool tolua_ret = (bool)  self->set_room_var(i_x,i_y,r_name,r_val);
   tolua_pushboolean(tolua_S,(bool)tolua_ret);
   tolua_pushcppstring(tolua_S,(const char*)r_name);
   tolua_pushcppstring(tolua_S,(const char*)r_val);
  }
 }
 return 3;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'set_room_var'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: set_coord_offset of class  pm3::PIXELLAYER */
#ifndef TOLUA_DISABLE_tolua_layerscript_pm3_LAYER_set_coord_offset00
static int tolua_layerscript_pm3_LAYER_set_coord_offset00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"pm3::PIXELLAYER",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,4,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  pm3::PIXELLAYER* self = (pm3::PIXELLAYER*)  tolua_tousertype(tolua_S,1,0);
  int i_x = ((int)  tolua_tonumber(tolua_S,2,0));
  int i_y = ((int)  tolua_tonumber(tolua_S,3,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'set_coord_offset'",NULL);
#endif
  {
   self->set_coord_offset(i_x,i_y);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'set_coord_offset'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* function: pm3::lua::get_active_layer */
#ifndef TOLUA_DISABLE_tolua_layerscript_get_active_layer00
static int tolua_layerscript_get_active_layer00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isnoobj(tolua_S,1,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   pm3::PIXELLAYER* tolua_ret = (pm3::PIXELLAYER*)  pm3::lua::get_active_layer();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"pm3::PIXELLAYER");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'get_active_layer'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
TOLUA_API int tolua_layerscript_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,0);
 tolua_beginmodule(tolua_S,NULL);
  tolua_module(tolua_S,"pm3",0);
  tolua_beginmodule(tolua_S,"pm3");
   #ifdef __cplusplus
   tolua_cclass(tolua_S,"LAYER","pm3::PIXELLAYER","",tolua_collect_pm3__PIXELLAYER);
   #else
   tolua_cclass(tolua_S,"LAYER","pm3::PIXELLAYER","",NULL);
   #endif
   tolua_beginmodule(tolua_S,"LAYER");
    tolua_function(tolua_S,"new",tolua_layerscript_pm3_LAYER_new00);
    tolua_function(tolua_S,"new_local",tolua_layerscript_pm3_LAYER_new00_local);
    tolua_function(tolua_S,".call",tolua_layerscript_pm3_LAYER_new00_local);
    tolua_function(tolua_S,"delete",tolua_layerscript_pm3_LAYER_delete00);
    tolua_function(tolua_S,"load_image",tolua_layerscript_pm3_LAYER_load_image00);
    tolua_function(tolua_S,"get_room_var",tolua_layerscript_pm3_LAYER_get_room_var00);
    tolua_function(tolua_S,"set_room_var",tolua_layerscript_pm3_LAYER_set_room_var00);
    tolua_function(tolua_S,"set_coord_offset",tolua_layerscript_pm3_LAYER_set_coord_offset00);
   tolua_endmodule(tolua_S);
  tolua_endmodule(tolua_S);
  tolua_function(tolua_S,"get_active_layer",tolua_layerscript_get_active_layer00);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 TOLUA_API int luaopen_layerscript (lua_State* tolua_S) {
 return tolua_layerscript_open(tolua_S);
};
#endif

